package workexp.reflection;

import org.junit.jupiter.api.Test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class testReflection {
    @Test
    public void testReflectionfun1() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        while(true){
            testReflect();
        }
    }

    public void testReflect() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class cls = Class.forName(TestRl.class.getName());
        Method m = cls.getMethod("hello");
        m.invoke(cls.newInstance());

    }
}
